<template>
  <view v-if="m_isLoaded">
    <view v-for="(item, _index) in m_pageList" :key="_index">

        
    </view>
  </view>
</template>

<script>
import { onMounted, ref } from "@vue/composition-api";
import { reqPost } from "../../common/http.request";
import { useUser } from "../../store/useUser";
import { uGetStorageSync, uNavigateTo, uToast } from "../../utils/uniUtils";

export default {
  setup() {
    onMounted(async () => {
      if (!useUser().hasLogin) {
        uToast("您还未登录！", "error");
        setTimeout(() => {
          uNavigateTo();
        }, 1500);
      } else {
        await GetPageList();
        m_isLoaded.value = true;
      }
    });

    const m_pageList = ref([]);
    const m_isLoaded = ref(false);

    async function GetPageList() {
      const { Data } = await reqPost("GetCouponList", {
        MemberId: uGetStorageSync("member").MemberId,
      });
      m_pageList.value = Data;
    }

    return { m_pageList, m_isLoaded };
  },
};
</script>

<style lang="scss" scoped></style>
